import service from '@/utils/request';

// 获取供应链列表
export function getSupplyList(data) {
  return service({
    url: `/api/system/supplyChainTemplate/pageSpace`,
    method: 'post',
    data,
  });
}

// 修改供应链
export function updateSupply(data) {
  return service({
    url: `/api/system/supplyChainTemplate/saveSupplyChain`,
    method: 'post',
    data,
  });
}

// 删除供应链
export function delSupply(id) {
  return service({
    url: `/api/system/supplyChainTemplate/deleteSupplyChain?spaceId=${id}`,
    method: 'get',
  });
}

// 供应链下拉
export function getSupplyListSelect(data) {
  return service({
    url: `/api/system/supplyChainTemplate/supplyChainTypeList`,
    method: 'post',
    data,
  });
}

// 供应链类型列表
export function getSupplyTypeList(data) {
  return service({
    url: `/api/system/supplyChainTemplate/pageSupplyChainType`,
    method: 'post',
    data
  });
}

// 供应链类型修改
export function addSupplyType(data) {
  return service({
    url: `/api/system/supplyChainTemplate/modifySupplyChainType`,
    method: 'post',
    data
  });
}

// 供应链类型删除
export function delSupplyType(id) {
  return service({
    url: `/api/system/supplyChainTemplate/deleteSupplyChainType?supplyChainTypeId=${id}`,
    method: 'get',
  });
}
